<?php

namespace app\Admin\model;

use think\Model;

class Grade extends Model
{
    //定义主键
    protected $pk = 'id';
    //定义表名
    protected $table ='art_grade';
    //定义全局查询范围
    protected function base($query){
        $query->where('status',1);
    }
    /**
     * 根据条件查询总数
     */
    public static function getSortCount($subject_id,$condition){
        $result = self::where('subject_id','in',$subject_id)->where($condition)->count();
        return $result;
    }
}
